<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>把数组转换为字符串 - toString()</title>
</head>

<body>
    <h1>JavaScript 数组方法</h1>
    <h2>toString()</h2>
    <p>toString() 方法以逗号分隔的字符串返回数组：</p>
    <p id="demo"></p>
    <script>
        var fruits = ["A", "Q"];
        document.getElementById("demo").innerHTML = fruits.toString();
    </script>
</body>

</html>